package com.browan.freepp.android.osyncclient;

import org.json.JSONObject;

public class OutlookTask extends OutlookAppointment
{

	private String m_owner;
	private String m_subjectUrlEncoded;
	
	public OutlookTask(){}
	
	
	
	public String getM_owner() {
		return m_owner;
	}



	public void setM_owner(String mOwner) {
		m_owner = mOwner;
	}



	public String getM_subjectUrlEncoded() {
		return m_subjectUrlEncoded;
	}



	public void setM_subjectUrlEncoded(String mSubjectUrlEncoded) {
		m_subjectUrlEncoded = mSubjectUrlEncoded;
	}



	public OutlookTask(JSONObject jo)
	{
		if (jo == null) return;
		try
		{
			m_subjectUrlEncoded = jo.getString("subject");
			m_subject = UrlCodec.urlDecode(m_subjectUrlEncoded);
		}
		catch (Exception ex)
		{
			ex.printStackTrace();
			return;
		}
		
		lastModified = getString(jo, "lastModified");
		
		m_owner = getString(jo, "owner");
		m_description = getString(jo, "body");
		
		String start = getString(jo, "start");
		String end = getString(jo, "end");
		
		m_syncId = getString(jo, "syncId");
		
		m_start = convertTime(start);
		m_end = convertTime(end);
		
		m_rrule = getString(jo, "rrule");
		if (m_rrule != null && m_rrule.length() == 0) m_rrule = null;
		
		m_reminder = -1;
		m_alldayEvent = false;
	}
	
	public String getUniqueIdentifier()
	{
		return m_subjectUrlEncoded;
	}
	
	public String toString()
	{
		return "  Subject: " + m_subject;
	}
}
